<template>
  <div>
    <van-field label="角色名称" v-model="form.name"></van-field>
    <van-button style="background-color: aqua" round @click="add">添加</van-button>

  </div>
</template>

<script>
export default {
  name: "add_relos",
  data() {
    return {
      form: {}
    }
  },
  methods: {
    add() {
      this.$axios.post('/admin/roles', this.form)
        .then(res => {
          if (res.data.code == 200) {
            alert('添加成功')
            this.form = {}

          } else {
            alert(res.data.mes)
          }
        })

    }
  }
}
</script>

<style scoped>

</style>
